package View.Game;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;

import javax.swing.JLabel;
import javax.swing.JPanel;

import Utils.MediaUploder;


public class ResultPanel extends JPanel{
	
	private MediaUploder media_;
	private Image imageBackground_;
	private JLabel label_;
	
	public ResultPanel(Boolean won, MediaUploder media){
		setLayout(null);
		
		media_ = media;
		imageBackground_ = media_.imageBackground;
		
		Dimension a = new Dimension(imageBackground_.getWidth(null),imageBackground_.getHeight(null));
		setPreferredSize(a);
		setLocation(0, 0);
		
		if(won){
			label_ = new JLabel("VC GANHOU!!!");
		} else{ 
			label_ = new JLabel("VC PERDEU!!!");
		}
		
		label_.setSize(400, 100);
		label_.setLocation(100, 100);
		Font font = new Font("Verdana", Font.BOLD, 40);
		label_.setFont(font);
		label_.setForeground(Color.RED);
		add(label_);
		
	}
	
	@Override
	protected void paintComponent(Graphics g) {
		// TODO Auto-generated method stub
		super.paintComponent(g);
		
		g.drawImage(imageBackground_, 0, 0, 800, 600, this);
	}

}
